package cn.fufeiii.bt.common.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

/**
 * @author FuFei
 */
@Getter
@Setter
@Component
@ConfigurationProperties(prefix = "cors.config")
public class CorsConfigProperty {
    /**
     * 允许的来源列表
     */
    private List<String> allowedOriginList = Collections.singletonList("*");
    /**
     * 允许的请求方式列表
     */
    private List<String> allowedMethodList = Collections.singletonList("*");
    /**
     * 允许的请求头列表
     */
    private List<String> allowedHeaderList = Collections.singletonList("*");
    /**
     * 需要校验跨域的路径表达式
     */
    private String corsPathPattern = "/**";
}